home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 208_01 / stdio.h < prev    next >
Text File  |  1987-10-11  |  2KB  |  50 lines

  1. /*      stdio.h 1.5     83/08/11
  2.  *        fixed for DRI C for CP/M68K
  3.  */
  4.  
  5. #define BUFSIZ  512
  6. #define _NFILE  16
  7. typedef struct  _iobuf {
  8.     int    _file;        /* file descriptor    */
  9.     int    _flag;
  10.         char    *_base;
  11.         char    *_ptr;
  12.         int     _cnt;
  13. } FILE;
  14. extern FILE _iob[_NFILE];
  15.  
  16. #define stdin  (&_iob[0])
  17. #define stdout (&_iob[1])
  18. #define stderr (&_iob[2])
  19.  
  20. #define _IOREAD    01            /* file open for reading    */
  21. #define _IOWRT    02            /* file open for writing    */
  22. #define _IOABUF    04            /* alloc'd buffer            */
  23. #define _IOMYBUF        04
  24. #define _IONBUF    010            /* file is unbuffered        */
  25. #define _IOERR    020            /* error has occurred on this file  */
  26. #define _IOEOF    040            /* EOF has occurred on this file    */
  27. #define _IOLBUF 0100            /* handle as line buffer        */
  28. #define _IOSTRI    0200            /* this stream is really a string   */
  29. #define _IOSTRG 0200
  30. #define _IOASCI    0400            /* this was opened as an ascii file */
  31.  
  32. /* the following is not defined in CP/M68K
  33.     #define _IORW   0400
  34.  */
  35.  
  36. #define NULL    0L
  37. #define FILE    struct _iobuf
  38. #define EOF     (-1)
  39.  
  40. #define clearerr(p) ((p)->_flag &= ~_IOERR) /* clear error flag            */
  41. #define feof(p) ((p)->_flag & _IOEOF)    /* EOF encountered on stream        */
  42. #define ferror(p) ((p)->_flag & _IOERR)    /* error encountered on stream        */
  43. #define fileno(p) ((p)->_file)        /* get stream's file descriptor        */
  44. #define getchar() fgetc(stdin)        /* get char from stdin             */
  45. #define putchar(c) fputc(c,stdout)    /* put char to stdout            */
  46. #define putc fputc
  47. #define getc fgetc
  48.  
  49. FILE    *fopen();
  50.